onReady defined twice