Take 'root' property into account

Replace the hard coded root path with the value in config file.