Added register function