Implemented Error message printing