fix bug in all_same