semi-properly fixed nonetype issue