replace preg_replace() with preg_split() on saveDoc() method