fixed bug in bin_script