Fixed idiotic substring, replaced with regex.