fix null error on registration