fix bug at registion