added writen hook