Added recursive mutex to fix issue with asyc callbacks