Added root detection