Philando Castile, who was killed earlier this month by police during a traffic stop, took a gun safety course last year where he learned how handle interactions with law enforcement with a firearm in the car.

After getting his gun permit last year, Castile took the required gun safety class with his sister in May 2015, the Associated Press reported. Dan Wellman, the owner of Total Defense in Ramsey, Minnesota, confirmed to the AP the Castiles attended class but did not remember the pair specifically.

This class did not prevent him from being shot by a Minnesota police officer earlier this month. Castile, a black man, was fatally shot July 6 after he was pulled over by St. Anthony police officer Jeronimo Yanez.

Castile’s girlfriend, Diamond Reynolds, live streamed the aftermath of his shooting and said Castile was shot while reaching to get his wallet and telling the police officer he had a gun and a gun permit.

At Total Defense, each class is taught how to behave during any encounter with law enforcement, Wellman said. Students are told to comply with all demands, hand over their gun permits with their driver’s licenses and calmly answer any other questions the officer asks.

“We make several jokes about it during class: ‘I have a gun’ is not the way to say you have a gun on you,” Wellman told the AP.

Get The Brief. Sign up to receive the top stories you need to know right now. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to Abigail Abrams at abigail.abrams@time.com.