ARMS-315. corrected syntax in javascript. updated method name and added comment for clarity.