How to make a function stays - C#