final logic fix