validation added to check if input file is valid