fixing as per @SimonCropp comments