change to using events