added ensures clause to writing capability