alex for register function