fixed document.ready snippet