fix draw loop