Added a method to Controller class to check whether listener received a message. Also added more print statements and fixed some bugs