Fixed search for user history query