working code up to - update query