putting in a check before uploading