change write method