Fixes upload function.