fix bug on remote upload