My player keeps rotating back to 0 degrees on the Y-axis after it turns

I’m making a character controller for a top down game, but after the character turns, when i let go of the movement keys, the rotation of the player goes back to 0 degrees on the y axis.

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerMovement : MonoBehaviour
    public float speed;
    public float turnSmoothing = 0f;
    public Animator chestAnimator, waistAnimator;
    public CharacterController controller;

    float horizontal, vertical;

    void Update()
        horizontal = Input.GetAxis("Horizontal");
        vertical = Input.GetAxis("Vertical");
        Vector3 movement = new Vector3(horizontal, 0, vertical);
        controller.Move(movement.normalized * Time.deltaTime * speed);
        transform.rotation = Quaternion.Slerp(transform.rotation, Quaternion.LookRotation(movement), turnSmoothing);

        if(horizontal != 0 || vertical != 0)
            chestAnimator.SetBool("walking", true);
            waistAnimator.SetBool("walking", true);
            chestAnimator.SetBool("walking", false);
            waistAnimator.SetBool("walking", false);

Input.GetAxis() will return 0 when no input is detected, so you are telling the player to rotate to 0 whenever there is no input.

I recommend Input.GetKey() instead.