add fix for null pointer