Fixed typo in setRoot logic