cleanup readyToServe function