Tries to correct the None-type not iterable error