Added zoom index bound check