adapted to latest RL2 updates