fix logic in last commit