better testing and fix bug in le script