Fixed onready handler.