modify static function to dynamic