Fixed issue where commands are sent multiple times.