upload function completes