Newly leaked e-mails reveal that pop sensation Ariana Grande lost a gig performing at the White House based on a video circulated online last year. The surveillance footage taken at a California doughnut shop showed Grande licking a tray of doughnuts and saying, “I hate America.” The footage was later picked up by TMZ and circulated across social media, creating a firestorm of controversy and criticism against the former Nickelodeon star. A White House staffer tasked with vetting Grande for the job responded to her request to perform with a resounding “Nope” upon learning of her extracurricular activities.

In refusing to allow Grande to perform, the White House joined the ranks of organizations that vet potential hires by checking applicants’ social media content. According to a 2014 survey from CareerBuilder, forty-three percent of employers use social networking sites to research job candidates. Of those, 51 percent reported that they refused to hire a candidate based on content found on social media. Forty-five percent of employers also use search engines such as Google to research potential job candidates.

While researching a candidate’s on-line presence could provide information helpful to the hiring process, the Society for Human Resource Management (SHRM) suggests that HR professionals follow some guidelines to ensure their snooping is lawful. For example, to avoid claims of discrimination, it is less risky to check social media sites after an applicant has been interviewed, when the applicant’s protected characteristics are already known to the employer.

In addition, employers should be consistent and subject all applicants to similar scrutiny. In other words, if you check one candidate’s social media profile, you should check others’ as well. Also, if you do rely on damaging content found online to deny employment, you should print the page containing the information to document the basis for your decision, in case the post is later deleted.

Lastly, keep in mind that some state laws limit your ability to refuse to hire an applicant based on off-duty conduct, and you may be subject to the federal Fair Credit Reporting Act (and corresponding state laws) if you use a third-party to investigate applicants’ social media activity.

If you follow these guidelines, you can rest easy and just say “Nope” to the next doughnut-licking applicant you encounter in the hiring process.