handle exception with file input