Added profile definition

Also added more debug prints in client