moved notification user setting code from action to function