Adding upload function