Input.acceleration on sphere with rigidbody(gravity)

I am making a school project, where I controll an sphere with devices accelerometer. Now everithing goes well, till I add rigidbody to the sphere.
Sphere dose move according to the information from accelerometer for few moments, but then it starts to get stuck. Like it would get stuck in the ground(cube in my case).

I am using this code for accelerometer:

 //move object using accelerometer

var speed = 10.0;


function Update () {

	var dir : Vector3 = Vector3.zero;
	
	dir.x = -Input.acceleration.y;
	dir.z = Input.acceleration.x;
	
	if(dir.sqrMagnitude > 1)
		dir.Normalize();
		
	
	dir *= Time.deltaTime;
	
	transform.Translate(dir * speed);

}

How can I get this to work. Or is there a different way to apply movement to the object with information from accelerometer and have gravity.

I am developing with JavaScript for Android 2.2

Translate by default acts in the local directions, what is a disaster for a sphere with a rigidbody: as the sphere rotates, the X and Y local directions at some moment will roughly point at the ground, making the sphere get stuck. Specify Space.World in Translate, and the world X and Y will be used instead:

  transform.Translate(dir * speed, Space.World);