fixed clean-up issues