fixed to set correct $directive