added a modalAdded and modalRemoved delegate call