fix for Nonetype