LookRotation not working like I want it to.

I’m trying to make a turret that spins on the Y axis to face its target, without tilting on any other axis, but something is just going wrong and it keeps freaking out on me. Please help. 3+ hours of searching all over the forums but nothing has helped me.

using UnityEngine;
using System.Collections;

public class Turret : MonoBehaviour {
    GameObject turretBase;
    GameObject turretGun;

    public float turnSpeed;

    public Transform target;

	// Use this for initialization
	void Start () {
        turretBase = transform.FindChild("Turret_Base").gameObject;
        turretGun = turretBase.transform.FindChild("Turret_Gun").gameObject;

	// Update is called once per frame
	void Update () {
        if (target != null)
            Vector3 lookPos;
            lookPos = target.position - turretBase.transform.position;
            lookPos.y = 0;
            Quaternion rotation = Quaternion.LookRotation(lookPos);
            turretBase.transform.rotation = Quaternion.Slerp(turretBase.transform.rotation, rotation, Time.deltaTime * turnSpeed);


Try adding a rigidbody on the object and freezing its x & z rotation