using custom writer