made device reading more robust