make script more correct