Fix misuse of a function