added correct z-indices to frames