Update model and add register function