changed some logic in what kvApply returns