add script to finalize output
add script to finalize output
fix check output script