better locking mechanism