bug fix on script blocks