added rollback/forward logic