changed devicesemas to int