generic register working