added rollback function