fix fundction