Fixed a context issue in javascript.