Adding close route
Removing writeHeader from writeTextToImage