added error messages in case things fail