fix for null pointer