added check on upload file