fixed some wrong code