Fixed problem with double document.ready