added console logging