Fixed upload functionality