Added checking for whitespaces