not writing city to db properly