fix submitted by Andy Schneider <andy.schneider@bjss.co.uk>