Fix for deprecation warning on spawn events