fixed cgf & added EventHandler