fixed small things (write returning id)