debug script modified