added check error for read