onready now works as a promise