root function fix