Fixing deprecated variable access warning