Removing spaces that cause syntax error