fixed registation bugs