add z-index
optimize code