updated query that gets user for notifications