Added logic to handle dismissing notifications