Fixed typo and added doc ready

I fixed a typo and made everything execute after document ready just for safety.