fix for when window is too small
fix not printing sometimes