It does work, you've just done something silly. ;D You're giving the game an object (like a unit) when its expecting an array. We really need more detail before we can help you, but its the kind situation where, in extracting that information, you'll probably find the mistake yourself anyway.
Edit: See! ;D