Added a function to utils.php