Solves issue of error msg when uploading wrong file type and weight at same time