range checking for goto command