updating the last commit logic