adapt according to gjin comments