Detach events before re-attaching them.