fixing some function.