More conventional way for setting headers and code
Fixed Flush