added support for adding function with checkbox