created add method which will be used to add a task to list