adding observer pattern