added console logs for errors