fixed bug in recorrect function