FInally fixed function text field errors (the function text field now sets the function correctly)