fix non-working function