fix draw segfault