fix bug of autolock.