fix bug registration