Updated hook to handle minification