added proper exit in case of non-readable file