correct handling of empty path