fixed general timing issue with "onready"