Fixed concurrency bug by adding actor