added simple state manager