Error checking on file input