added waitReady to init