Fix no function clause matching error