Fix script error, missing "then"