fixed nonetype bug