Fixed NoneType error - fixed