Move dimension variable one scope up, so it can be accessed from else branch (line 755)