enhance to echo out error when failed