Nonetype Object Is Not Subscriptable