added optional emit event to the external clear method