fix javascript not loading on click