collision with border and drawing fix