rewrite enqueue script to be script debug friendly