Added heartbeat check, added close button