added roles count check