fixed clamping issue