fixed some exceptions while uploading files