Added functionality for editing events