Fix ready callback emptying logic