Added resource cleanup to example 3
added stateful actors