Making dismissing compatible with targetSdkVersion=21