make scripts more reliable