added test for overwrite mode