Bug fix in fry function