added ready check loop