Some logical changes in profile and messandger class