fixed typo bug with flag parsing