fixed a subtle but annoying bug