Added exceptionHandling. Improved writeOperations