fixed incorrect logic from previous commit