upload working correctly, need to add failsafes and fix db