fixed multiple ready function call bug