working again on check logic