updated logic to handle pr1