Fixed calling of wrong function and refactored some codes.
Fixed wrong message for notifications.