fixed bad function call