fixed the major logic bug, forget to update max_feature variable