add constructor for json deserialization