Added state global to clean up listener