added options to writetext