Corrected global hooks functionality