Fix for commands repeating infinitely