fix bug by returning to closure style