Remove while cycle in stack_project