fix logic for checking bad names