Move code inside the $(document).ready() call