Fixed error in rendering order