fixed a minor locking issue