Fix locking machnism