updated register method