fixed query issue in search controller