code updated to avoid unnecessary crash for kitkat.