made sure clean-up is always performed