Modified to use Transaction