fixing uplaod function