Changed to use a Hook instead.