Fixing bug in javascript invocation.