added error handling and continue from profile id