fix according to Tim's comments