Added query to retrieve detail for profile