fixed some function