how does critical thinking help a nurse prevent medical errors