Fixed "then" to execute on child scope