fixed TypeError