fix nonetype return