Add more logic for handling notifications