implemented Observer pattern