error with duplicate saving check