Fix problem in query TODO research option to return last inserted row