Correct a bug moving temporal variable to other method.