script scanner bug fixing