Added lock to stop multiple indexing processes. closes #11