Fix remove resource event listener