solution for dynamic