user id writing in database