better fix for z ordering