added write query