changed the click function to run on ready