added check for register