try write function