added lock cmd, bugfixes