since you did header = [header_data], this will always be true. maybe you need to rename the param to 'needs_header' or something like that?