fixe bugs in path resolution