Invalid state passed to GetStateEnabled

So I have this script that detects when the player is standing still, but every time I start moving this error comes every single frame, it starts to lag up after a couple minutes.

So is there any way of detecting when the player is in its idle state without using Humanoid.MoveDirection?