added heartbeat and fixed orientation