After a couple of bumps in the road,  indie western “Jane Got a Gun” looks to be back on track with Bradley Cooper in talks to join the cast.

Cooper would replace Jude Law, who left after the film’s original director, Lynne Ramsay, dropped out of the project.

The pic stars Natalie Portman and Joel Edgerton with Gavin O’Connor helming.

“Gun,” penned by Brian Duffield, follows a woman who asks an ex-lover to help her save her outlaw husband from a gang that’s out to kill him.  Edgerton plays the ex-lover while Cooper would play the gang leader.

Film will be the first for Scott Steindorff’s Scott Pictures. Producers are Steindorff, Aleen Keshishian,  Terry Dougas and Portman.

Several weeks ago, it seemed like the film was falling apart after Michael Fassbender departed due to scheduling conflicts. Edgerton, originally cast as the gang leader, stepped into Fassbender’s role and Law was brought on to play the villain.

On the day production was due to begin, Ramsay left the project due to creative differences and Law shortly followed. Producers were able to act fast and recruit O’Connor but the role of the antagonist still needed to be filled.

The Cooper casting is not only important in getting production back on schedule but also helps keep the financing onboard. When Fassbender left the project, international investors began to worry that they had been sold a film with Fassbender as the male lead, not Edgerton.

Cooper, repped by CAA, is about to wrap production on David O. Russell’s untitled political thriller.