updated set-parents script