Fixed regression for dynamic parent

Fixes #1578 
just ``if`` as the previous case returns