Made state serializable