It says undefined label after ending. How do I make the program end if a file is missing?