Fixed bug in javascript.