Use safeapply in active and sticky directive