fix possible but rare crash