handle script internal error