fixes in function.