./build.sh
fix dangling pointer deletion with a safety check hack