some major fixes