Modified JS for table