version with ready event hooks