Airplane control

Hello guys.

I want to make a script for the control of an aircraft using the acceleromenter.
I wrote these two lines but I do not understand why even if you turn my airplane always continues to go straight in the same direction.

var speed = 2;
var rotateSpeed = 2;

function Update()
{
	transform.Rotate((Input.acceleration.x * rotateSpeed), (-Input.acceleration.y * rotateSpeed) ,0);
	rigidbody.AddForce(Vector3.forward * speed);
}

You are applying a force in the Vector3.forward direction in world space, instead of the airplaneā€™s space. Use this instead:

rigidbody.AddForce(transform.forward * speed);