Added stateful behavior, currently the test doesn't pass
Added missing test