fixed error if file is not found or empty