try to make sure that redraws always happen in the end