added directory checks and changed all paths

Jira-issue: WP-1265