fix for null ref