Improved locking mechanism