Converted menuExists to use the new query function