do some cleanup in case of failure