observer pattern seems to work as expected