add codes for compatibility of windows phone 8