Fixed a local var problem