fixed root and log checking in controller