tweaking debugging script to spot problems