try to use observer pattern