added transaction on writes

Signed-off-by: Lyndon Michael Bibera <secret.transaction@gmail.com>