fixes duplicate resource clean-up