There appears to be something amiss with the legal process when it comes to stalking offences in Scotland.

The former lover of writer Janice Galloway, Graeme McNaught, was found in court to have acted in a threatening and abusive way towards the author. In spite of this, Crown requests that he be put under a court order not to contact Ms Galloway were turned down. On Monday, he was told he would face no further punishments.

According to Ms Galloway, McNaught was turned away from her home and police called that night.

The author understandably feels "extremely let down". She had reached the end of a stressful court process in which her former partner was found to have carried out a series of offences, only to find that the sheriff was unable to grant a non-harassment order that could protect her from further contact with McNaught. In 2010, a new law of stalking was enacted in Scotland which was supposed to put victims first. This case suggests it is not always working out that way.

The problem appears to lie with the legal process. McNaught, in spite of being found to have committed the acts, was not actually convicted of them, his trial having been halted earlier due to concerns about his mental health. The sheriff's hands were therefore tied. He explained that a non-harassment order may only be made if there is a conviction. Psychiatric reports ruled that there was no need for an order; Ms Galloway fervently disagrees.

The distress caused by stalking can be extremely debilitating. At best, a stalker is a nuisance; at worst, stalkers can put their targets into a near permanent state of anxiety, fearing for their own safety and that of their loved ones. Scotland's updated stalking law was intended to ensure that victims would have better protection against stalkers. Previously, stalking had been prosecuted as a breach of the peace which was required to have a "public element". That is no longer sufficient in the social media age when harassment may be by text message and email. Now a wider range of behaviour falls within the law.

Yet clearly, in some respects, the law is not working as it should. The best interests of the victim have not been served by the unsatisfactory outcome of this case. How many other people have found themselves in a similar position, wonders Ms Galloway? She is right to ask.

It is vital to ascertain how widespread the problem is and how it can be rectified. Therefore, the Crown Office's review and consideration of any "legislative gaps" is to be welcomed.

This is not the only occasion that the functioning of Scotland's stalking laws has come under scrutiny. Concerns were raised last year about the relatively low conviction rate. By October last year, fewer than one-third of people reported under the new regime had been convicted. As MP Sandra Osborne said at the time, the relatively low conviction rates for stalking appeared similar to those of crimes of violence against women. Still, there has been a big improvement in Scotland's approach to stalking.

Even so, this latest case shines a light on its shortcomings. Victims of stalking have a right to live in peace, not under a perpetual cloud of anxiety and fear. A full examination of the perpetrator's mental health will be essential in many cases and must, of course, be taken into account by sheriffs but a better balance must be found between the humane treatment of these troubled individuals and the need to protect their victims from the threat of further harassment.