added check to fix warnings