Fixed to use new function