assert error message cleanup + memory cleanup