Updated add task functionality