Updated code to list all dir of user account

was facing issue on recursive looping in showing dir list in earlier
code. Fixed it in this updated.