Added additional parameter to hook function