use error log instead of panic