fixed access to local variables