fixed registration bug