Fixed a bug (javascript call failed when clicked on buttons)