return value other than 0 was stopping.

Return value other than 0 was stopping to move further. So changed it echo the result at the place of using return 0.