added console statment for error message