fix query for insert