adds missing nonetype check