fix drawing weird behaviour