Fixes concurrency issue
Adds extra exit for safety