Added setUserType() function