bug with foward declerations in local function, don't understand it require help.