better string checking