Fix a bug in holding function after restart game

controlling vaiable type is changed from static to non-static