Adding "lockKeyBuffer" method