Existence and uniqueness for BSDE with stopping time