fix bug checkActiveDevice