Changes of adding error code & formatting