properly handle input format