better path resolving