Revert "fixed order of teardown"

This reverts commit dda147c12a72e752e9f99bbe7d2bbf702b648cbd.