fixed a bug where a lock was being acquired instead of released