throws the appropriate error when a duplicate operation is found
Merge pull request #112 from yushan87/more-fixes

throws the appropriate error when a duplicate operation is found