Fixed error nonetype