Added checking of user type