update define_method with dynamic params