Added register method

Added register method which is now working correctly.