Added simple example for automatic locking