changed code for phonestatelistener