small bugs in script