add click listener and cleanup