Fixed bug in drawing