This could get into concurrency issues too. Could you put this inside a try-catch?