Added closure
Added support for alerts