whitespace safety

Added some error checking to prevent potential errors with whitespaces
on the language settings