added one extra check