Added if statement to catch if server receives a invalid packet.