added whitespace detection