Moved notification to a new function