fix cmd line parsing code