Changed functions so they are sent correctly.