changed upload return function