clean up after errors during layer setup