fixed S H flag bug