Density functional studies of the magnetic properties in nitrogen doped TiO2