stop auto paint before delete border to avoid possible invalid memory access, thanks to valgrind