Fix ready function.