added global variable @students and replaced local variable to enable functionality