observer pattern script