Fix Op stackoverflow bug, Script helper method