Change parenting() function to wait() function