add error handling to upload, add messageid encoding to arrived message