Fix error in directive for optional