only passing keys array if a key is present