Added the case for null
Handle it as empty instead
Commited an syntax error ... wow
Clean up the listener each time.
Refactored to use attributes.