check if target is a folder