fix model query