Updated JS to accomodate the toggel button changes