Added a user data save function right before triggers are set for consistency in trigger setting.