Added in the code for dealing with the popup animations