fixed bug in initializing r directories