Added the locking system