hopefully fix logic