Function to add task with title