reentrancy

Signed-off-by: Martin Evans <martindevans@gmail.com>