added file check validation to the program