First person footsteps query

Im having issues with my footstep sounds. When sprint is pressed the footstep sounds should come faster but this only happens if shift is pressed before movement, if the character is moving when shift is pressed the character will sprint but the footsteps dont change. Its probably a simple fix but cant think of how to solve this,