moved lock above Len() check to prevent a race condition with adding new elements
Merge pull request #31 from andrewzeneski/master

Moved locking to prevent race conditions