added profiles controller with logic