work on serialization for JS