fix bug in script