more query fixing