Fix preventing multiple calls to the ready callback