change helpers order to prevent premature headers sent