fix unit mapping computation