bug fix query