switch 2011/2012, fix for tree index accepting only up to int