Added after_spawn hook