Riz Ahmed has long been an actor and is set to star in the forthcoming Venom, but you'd be smart to never forget he's also Riz MC, solo rapper and member of the Swet Shop Boys. And his skills are nice enough to have to gotten him out of a potentially sticky situation, he told Jimmy Kimmel on Wednesday night.

Ahmed shared how he recently visited his home country of Pakistan, and while there, wanted to visit a shrine on an island off the coast of Karachi, the capital. While he and his friends were wondering how they were going to get to the island, a “12-year-old pulls up in a rickety pirate ship and [says] like, ‘Need a ride?’” Ahmed says around the 5:55 mark above.

When Ahmed and his friends landed on the island, they were immediately approached by army officers who told them that there is a shrine, but the island is now a naval base. They attempted to detain Ahmed and company because they were foreign passport holders. The officers asked what they’re doing on the island, and Ahmed quickly remembered that “poets are held in such high esteem” in Pakistan. So he decided to wow the officers with rapping.

“They said, ‘What are you doing here?’ I said, ‘I’m a poet, a rapper.’ So this guy was like, ‘What you got?’ So I then find myself in this surreal situation of having to freestyle rap for my freedom from being detained by military intelligence on a naval base in Pakistan. So I started rapping, and they liked it and they let me go.”

Venom, which also stars Tom Hardy and Michelle Williams, is set to release on Oct. 5.