Extend controller in to_prepare hook