Trouble making missile facing direction of travel

hi all~
I have 2 gameobjects in my test scene, I called it origin and target.
and missile would fire from origin’s position and move towards target position in an arc .
I got the moving in arc motion done and is working…however I have trouble making missile rotates to the direction it is traveling.
I tried lookat , and Quaternion.LookRotation.But the same thing happens, it would not rotate pass 90 degree in X axis…I am not sure how to fix it…here is my code…please help…much appreciated.

using UnityEngine;
using System.Collections;

public class ds : MonoBehaviour {
	
	public Transform origin;
	public Transform target;
	public Transform missile;
	float distance;
	Transform aobj;
	float aval;
	float roX;
	float starttime;
	bool canmove;
	// Use this for initialization
	void Start () {
	
	distance = Vector3.Distance(origin.position,target.position);
	Vector3 tpos = (origin.position + target.position) / 2f;		
	aobj = Instantiate(missile)as Transform;
	aobj.position = origin.position;

	}
	
	// Update is called once per frame
	void Update () {

		if(Input.GetMouseButtonUp(0)){
			canmove = true;
			starttime = Time.time;
		}

		if(canmove){
			
		Vector3 center = (origin.position + target.position) *0.5f;
		center -= new Vector3(0,1,0);

		Vector3 origincenter = origin.position - center;
		Vector3 targetcenter = target.position - center;
		
         float speed = (Time.time - starttime) / 5f;

		Vector3 newpos = Vector3.Slerp(origincenter,targetcenter,speed);

		//missile rotation here
		Vector3 relativepos = target.position - aobj.position; 
		aobj.rotation = Quaternion.LookRotation(relativepos);	
	   //missile movement 
		aobj.position = newpos;
		aobj.position += center;
		}
	}
}

Does it have a rigidbody?
Quaternion.LookRotation(rigidbody.velocity);
If not, you have to calculate the next Position at your arc and use
transform.LookAt(nextPosition, Vector3.up);

Yes…I do have rigidbody on the missile. I have tried Quaternion.LookRotation(rigidbody.velocity) as you have suggested.
However it doesn’t work. I have tried to freeze and unfreeze all constraint and test it. It is still not working.
Am I doing something wrong?

Update
I changed this from
aobj.rotation = Quaternion.LookRotation(relativepos);
to
aobj.rotation = Quaternion.LookRotation(newpos);

and it works but then when rotates up to 270, the missile just flipped…

Well, maybe because you are using a rigidbody, but… not using it. If you set positions by Hand (your own calculation), rigidbody.velocity might likely be unaffected.
Use rigidbody.AddForce for a realistic arc and you geht rigidbody.velocity for your direction or set lookat to your next Position.
relativePosition should only point to your target or something like that.

I did a quick recording of what is happening now with the rotation

as you can see, the missile rotates fine unity towards the end, it just rotates 180 degrees…
and as stated before my rotation code is

aobj.rotation = Quaternion.LookRotation(newpos);