use events to manage state. working much much better