z order bug fix