functinal add new task, edit existing task