Replaced __declare_last__ with more robust listener solution