Added initial z-index for the first element
Added check of index in show method