added a line to do not have double header access, and changed echo variable syntax, more stable on multiple os