Replaced echo with return inside of function