Fixed javascript enabling/disabling events