Add error message for failed file opening