added stack safety example