changed to $(document).ready()