Shouldn't we be setting up the ready event inside an else here?