working implementation of leader key