extract safeApply cause we need it