Updating check to ensure data is available before trying to read it