updated for multi devices