Added check to make sure toLower doesn't fail when parameter isn't an string