fixed onready function