The name var was getting clobbered in the initial for-in loop, so the second loop would never be entered.