Added check for invalid stats