js event fix for collapse