updated the workings of the upload functionality almost done