fixed a bug where primitives could not be serialized with JSON