better error handling
implements sumbit to upload post request