fixed extra paths not being trimmed