fix(scripts): fixing the script error function