fix #564: check if parent id is already here
Merge pull request #568 from Raz0r/patch-3

fix #564: check if parent id is already here