Move the listener code in the SP