dont call pre/post write callbacks if callback is null