Fixed bug for $.getDevice