added some functionality to notify method