separating event handlers and functions, can now properly create an edited task