fix variables scope warning