fix bug with drawing order