Updated Event Function with Create, Update, and Edit