fix "can't set headers after they are sent"
fix "can't set headers after they are sent"