fixing stream layout