s/$query/$q/ when checking for empty query