added clamping