trying to write in database