Added support for setting prefilled with a function