trying to diagnose a null pointer exception that only happens with certain sketches