fixed a bug in the rewind feature. Fixes #40