use null for errors