Fixed bug for key values with spaces