added code to register clients