fixed the main parser