fixed a function