Ensure no race conditions on handlers