func did not work, fixed