TODO in write, extra exception should be thrown.