fixed passing in flags