Fixed sending wrong code leading to hang in communications