fixing functions and calls