minor optimization and fixed more option