added registration adn logging in functionality