change ready event; add hooks