quick fix to avoid errors about setting headers too late