Fix messages URL hook handler