improved stack deallocate