add mutex lock to allow many concurrent instances