fixed problems with javascript bind events
- to fix, removed async iteration and used for loop
- removed jquery bind event and used DOM onclick