fix to seg script