fix bug exposed by a colleague