fixes printing so it will not write to invalid address when using an offset > 0