minor change to ready function