added check for empty path-string