fixed key value mapping issue in generateOutput