fix format handling. fix #154