Fixed wrong javascript format in javascript functions