added forgotten sql part