fix the non-working functions