modification for php 5.5 (preg_replace /e modifier deprecated)