fixed some bug in uploading file