Fixing infinitely recursive function call.