modified conditional logic