Add some basic locking