Added support for animation complete trigger to work properly when using the back button