fixed registartion bug