checking in recursion