#31 - changed order of events