added directory checks before syncronization