added validation to file uploading