Fix NoneType not itterable error