fix update z-index function. Wasn't updating unless the note itself was clicked