rewrated parse args function