working implementation of notification pattern