fix javascript not working without page reload
smth