Updated ctp() with better notification handling