Fixed TypeErr issue