fixing as per @jerith's suggestions