Fixed bug when drawing background