functions updated for registering