support dynamic param for extend. Fixes #37