added validation of the path