corrected bug on curve