a bit better root handling