Make todo list and flush buffer