fix logic of last commit