Fixed uploading to DB