fixed bugs in draw class