Fixed warning about scope of var