fix reversal bug