solution for dynamic cell problem