My game frozzes when I use a while to check if there's colision

Ok so I’m still having the problem whit the jump scrip([last post][1]) so I almost fixed it but now when I press my UI button for it my unit frizzes and I have to launch it up again!
Heres my Code:

public void GroundCheck(Collider2D coll){

                                // ground is self explained I hope...
				while (coll.gameObject.name == "ground") {
			
						rigidbody2D.velocity = transform.up * 15;
						
			            
				
			            }
			    
			        



  [1]: http://answers.unity3d.com/questions/862880/disable-jumping-more-than-once.html

Use this instead

void OnCollisionEnter2D (Collider2D col) {
     //code here
}

There’s no exit for your while loop. This will cause Unity to freeze. Use “Update” instead of while loops.