added registertype function