add check for device given