added new write() for single target