added check before ordering