Modified to allow command event fire on main element