using TypeError over Error