changed implementation to use nsnotification