! Add check if headers are already sent to prevent Ubeat crash

We'll need to investigate on that, this is a quick hack to keep the app up and running.