make sure we reset the state when starting an upload in the javascript