INSERT statement for heartbeat almost working