updated path handling