Changed the calling of activate and deactivate just before transition