fixed error in the g_manager sql code