apply prototype dynamically