Make sure we have a string before using toLowerCase