fix for leaving stack