fix bug undefined unit causing crash in monkey interaction code