Fix variable usage before it defined