Fortunately /close doesn't have massive error checking, so no need to check if $query(nick) exists before attepting to close it.