fix crashing bug in virtual device