fix lifecycle of controller