Fixed edit task function