trying to fix stack problems