fix lifecycle events