gateway: reset event listeners after file deletion.