fixed logic bug (my fault)