More boilerplate. key lock control added.