handle empty result case
move functions implementation in functions.php file