fixed some code