Corrected missing bracket in javascript