fix logic of previous commit