add some new stuff and fix bug edit CustomEvent table to not be able to take null.