fixes #2298 implementing java.io.Serializable