pass array key to closure as well