rearranged some logic to prevent multiple locks from being acquired simultaneously - fixes #1
version bump