added check to verify uploaded file is correct format