bug fix for root detection