Debugging v0.159, added document ready check