updated js for tabs