Made the guessRole method compatible with php version <5.4