fixed focus issues in define_function block