added ensures clause to writing capability
Merge pull request #45 from yushan87/minorfix

added ensures clause to writing capability