user header error fix, small code cleanup