small changes to be able to read full mem