move script into document.ready()