code to detect phonefall