fix badmatch return