Check if target is directory in top choose component
Remove undefined function