fixes #13, use the value instead of key of directories to construct path