detecting by looking at stack