added error check if file is empty