modify upload fn