hamlet mode hook