added support for swipe to dismiss