implement isValidFragment to fix Android bug fixed in Android API 19 (Kitkat), close #161