Fix bug (cache was redrawed before the assignment had taken place)