this function does not clear actually. it returns the filtered todo list.