replaced new sample code of func.php