use trim instead of preg_replace