Added write to DB