Correcting some minor issues and allowed a preg_replace for the redirect link being returned.