change write methos to support upcase method