Fixed bug with not indexing nested divs properly