remove terminating underscores