stuck in how to access external variable