fixed wrong check