fix a function