fix register functions