[fix] Added missing readyState check and `end` emits