add debugging to script