prevent crash when spaces are found in key value pairs