Fixed dismissing controller, when animations completion block is executed before animations are actually finished.