Added undefined zIndex prevention