fixes curren page is index in do_upload function