added register code in model and added helper