correctly handle local function definitions : should be locals and not globals