In reply to geetika6:
Your problem is simple:
phase.get_objection();
does not return an object. You have to say what should happen in this situation. You are simply issuing an error message.
BTW I try to understand what do you want to debug with the heartbeat. In my understanding this is a feature to visualize something.