Updated code for notifications