fixed some register problems