Update hook to work on both modes